package com.wangbo.collection;

import java.util.ArrayList;
import java.util.Arrays;

public class TestArrayList {

    public static void main(String[] args) {
        test01(); // [1, 2, 3]
    }

    /**
     * List -> Array
     */
    public static void test01() {
        ArrayList<Integer> list = new ArrayList<>();
        list.add(1);
        list.add(2);
        list.add(3);
        Integer[] arr = list.toArray(new Integer[0]);
        System.out.println(Arrays.toString(arr));
    }
}
